//////////////////////////////////////////////////
// glSceneSpatial.h
//
// Author: Tarik Belabbas et Adrien Hoffer
//////////////////////////////////////////////////

#ifndef GLSCENESPATIAL_H_
#define GLSCENESPATIAL_H_

#include <glm/glm.hpp>

class glSceneSpatial
{
public:
	glSceneSpatial							();
	virtual	~glSceneSpatial					();

	virtual void	updateWorldTransform	();
	virtual void	render					() = 0;

	// Parent
	glSceneSpatial*			getParent		()			{ return m_parent; }
	const glSceneSpatial*	getParent		() const	{ return m_parent; }
	void					setParent		( glSceneSpatial* parent )	{ m_parent = parent; }

	// Local transform
	void				setLocalScale		( float _scale )	{ m_localScale = _scale; }
	float				getLocalScale		()	const	{ return m_localScale; }

	void				setLocalRotate		( const glm::mat3& _rotate )	{ m_localRotate = _rotate; }
	const glm::mat3&	getLocalRotate		()	const	{ return m_localRotate; }

	void				setLocalTranslate	( const glm::vec3& _trans )	{ m_localTranslate = _trans; }
	const glm::vec3&	getLocalTranslate	()	const	{ return m_localTranslate; }

	// World transform
	float				getWorldScale		()	const	{ return m_worldScale; }
	const glm::mat3&	getWorldRotate		()	const	{ return m_worldRotate; }
	const glm::vec3&	getWorldTranslate	()	const	{ return m_worldTranslate; }

protected:

	glSceneSpatial*	m_parent;

	float		m_localScale;
	glm::mat3	m_localRotate;
	glm::vec3	m_localTranslate;

	float		m_worldScale;
	glm::mat3	m_worldRotate;
	glm::vec3	m_worldTranslate;
};

#endif /* GLSCENESPATIAL_H_ */
